home *** CD-ROM | disk | FTP | other *** search
- //@line 37 "/c/mozilla/toolkit/mozapps/preferences/fontscaling.js"
-
- var gFontScalingDialog = {
- init: function ()
- {
- sizeToContent();
- },
-
- onAccept: function ()
- {
- // Get value from the dialog to work out dpi
- var horizSize = parseFloat(document.getElementById("horizSize").value);
- var units = document.getElementById("units").value;
-
- if (!horizSize || horizSize < 0) {
- // We can't calculate anything without a proper value
- window.arguments[0].newdpi = -1;
- return true;
- }
-
- // Convert centimetres to inches.
- // The magic number is allowed because it's a fundamental constant :-)
- if (units == "centimetres")
- horizSize /= 2.54;
-
- // These shouldn't change, but you can't be too careful.
- var horizBarLengthPx = document.getElementById("horizRuler").boxObject.width;
- var horizDPI = parseInt(horizBarLengthPx) / horizSize;
-
- // Average the two <shrug>.
- window.arguments[0].newdpi = Math.round(horizDPI);
- dump("*** intergoat = " + window.arguments[0].toSource() + "\n");
-
- return true;
- }
- };
-
-